#ifndef  __SHT20_H__
#define  __SHT20_H__
#include "gd32f1x0.h"
#include "Delay.h"
#include "stdio.h"

#define SHT20_SCL_H    GPIO_SetBits(GPIOA, GPIO_PIN_12)
#define SHT20_SCL_L    GPIO_ResetBits(GPIOA, GPIO_PIN_12)
#define SHT20_SDA_H    GPIO_SetBits(GPIOA, GPIO_PIN_11)
#define SHT20_SDA_L    GPIO_ResetBits(GPIOA, GPIO_PIN_11)
#define SHT20_SDIN_IN  GPIO_ReadInputBit(GPIOA,GPIO_PIN_11)

#define SHT20_Addr_W   0x80
#define SHT20_Addr_R   0x81
#define SHT20_reset    0xFE
#define SHT20_read     0xE7
#define SHT20_write    0xE6
#define SHT20_Content  0x02

#define Test_temp      0xF3   
#define Test_Hum       0xF5

#define SHT20_IIC_test_1 0x0a
#define SHT20_IIC_test_2 0x02

extern float SHT20_temp;
extern float SHT20_humi;
extern u8 SHT20_humi_SHT20_temp_flag;


void SHT20_Init(void);

void SHT20_Measure(void); 

#endif

